﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace RbmlVisualizer
{
    public enum FileType
    {
        UML,
        RBML
    }

    public class DiagramFile
    {
        public string DiagramFilePath { get; set; }
        public string ImageFilePath { get; set; }
        public FileType FileType { get; set; } 
        public string Content { get; set; }

        public string DiagramFileNameOnly
        {
            get
            {
                return Path.GetFileName(this.DiagramFilePath);
            }
        }

        public string ImageFileNameOnly
        {
            get
            {
                return Path.GetFileName(this.ImageFilePath);
            }
        }
        
        public override int GetHashCode()
        {
            return this.DiagramFilePath.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            var diagram = obj as DiagramFile;
            if (diagram != null)
                return diagram.DiagramFilePath == this.DiagramFilePath;
            else
                return false; 
        }
    }
}

